<template>
    <el-container style="padding: 30px 10%">
        <el-menu :router="true" :default-active="$route.path">
            <el-menu-item>
                <template #title>
                    <Avatar/>
                </template>
            </el-menu-item>
            <template v-if="userStore.account.authority === 3">
                <el-menu-item :index="`/user/myProject/${userStore.id}`">
                    <span>我的项目</span>
                </el-menu-item>
                <el-menu-item :index="`/user/involveProject/${userStore.id}`">
                    <span>参与项目</span>
                </el-menu-item>
<!--                <el-menu-item :index="`/user/receipt/${userStore.id}`">-->
<!--                    <span>发票报销</span>-->
<!--                </el-menu-item>-->
            </template>
            <el-menu-item v-if="userStore.account.authority === 2" :index="`/user/myDirect/${userStore.id}`">
                <span>第一指导</span>
            </el-menu-item>
            <el-menu-item v-if="userStore.account.authority === 2" :index="`/user/mySecondDirect/${userStore.id}`">
                <span>第二指导</span>
            </el-menu-item>
            <el-menu-item v-if="userStore.account.authority === 1" :index="`/user/myInform/${userStore.id}`">
                <span>我的公告</span>
            </el-menu-item>
            <el-menu-item :index="`/user/info/${userStore.id}`">
                <span>个人资料</span>
            </el-menu-item>
            <el-menu-item :index="`/user/account/${userStore.id}`">
                <span>账号管理</span>
            </el-menu-item>
        </el-menu>
        <el-main style="padding: 0 10px">
            <router-view></router-view>
        </el-main>
    </el-container>
</template>

<script setup>
import Avatar from "@/views/User/components/Avatar.vue";

import {useUserStore} from "@/stores/user"

const userStore = useUserStore()
</script>

<style scoped>
.el-menu-item{
    justify-content: center
}
</style>